﻿using System;
using System.Data;

namespace MuYue.ORM
{
    /// <summary>
    /// ORM数据库执行接口
    /// 任何数据库驱动都需要实现该接口
    /// </summary>
    interface ISqlHelper : IDisposable
    {

        /// <summary>
        /// 执行无返回结果集的sql
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        int ExcuteSql(string sql);

        /// <summary>
        /// 执行数据集的查询
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        DataSet QueryDataset(string sql);

        /// <summary>
        /// 查询结果是某确定值的查询
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        object QuerySingle(string sql);
    }
}
